package com.zt.controller;

import com.zt.anno.LoginOperation;
import com.zt.pojo.Emp;
import com.zt.pojo.Logininfo;
import com.zt.pojo.Result;
import com.zt.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/login")
public class LoginController {
    @Autowired
    private EmpService empService;
    @PostMapping
    @LoginOperation
    public Result login(@RequestBody Emp emp){
        Logininfo logininfo = empService.login(emp);
        return Result.success(logininfo);
    }
}
